php forum
php mysql forum
php mysql smarty
 
Topic Options
#285592 - 06/20/05 06:16 PM Beta-[6.4] Today and Yesterday
bostongio Offline
Lurker

Registered: 09/30/04
Posts: 8
Mod Name / Version: Today and Yesterday <br /><br />Description: You know how some forums list posts with the date showing "Today" or "Yesterday" as the post date (instead of or in addition to the actual dates)? <br /><br />This mod makes a simple change to ubbt.inc.php to add this functionality.<br /><br /> <br /><br />Working Under: UBB.Threads 6.4 <br /><br />Mod Status: Beta <br /><br />Any pre-requisites: <br /><br />Author(s): bostongio <br /><br />Date: 06/20/05 <br /><br />Credits: Other forum software <br /><br />Files Altered: ubbt.inc.php <br /><br />New Files: <br /><br />Database Altered: No <br /><br />Info/Instructions: <br />In ubbt.inc.php<br /><br />Find (under Convert the time):<br /><br />
Code:
<br />      if ($timeformat == "short1") {<br />        $time = @date("m/d/y h:i a", $time);<br />      }<br />      elseif ($timeformat == "short2") {<br />        $time = @date("d/m/y h:i a", $time);<br />      }<br />      elseif ($timeformat == "short3") {<br />        $time = @date("y/m/d h:i a", $time);<br />      }<br />      elseif ($timeformat == "short4") {<br />        $time = @date("d/m/Y H:i", $time);<br />      }<br />                elseif ($timeformat == "short5") {<br />                        $time = @date("H:i d/m/Y", $time);<br />                }<br />      elseif ($timeformat == "long") {<br />        $time = @date("D M d Y h:i a", $time);<br />      }<br />
<br /><br />Replace with:<br /><br />
Code:
<br />// Still show the date in addition to the words "Today" and "Yesterday"? 1 = Yes, 0 = No<br /><br />$j_show_moddate = 1;<br /><br /><br />  $j_today = date("m/d/y");<br />  $j_yesterday = date("m/d/y", strtotime("-1 day"));<br />  $j_tdate = @date("m/d/y", $time);<br />  $j_time  = @date("h:i a", $time);<br /><br />  if ($j_show_moddate) {<br />        $j_showdate = "($j_today)";<br />        $j_showyester = "($j_yesterday)";<br />  }<br /><br />  if ($j_tdate == $j_today) {<br />        $time = "Today $j_showdate at ".$j_time;<br />  }<br />  elseif ($j_tdate == $j_yesterday) {<br />        $time = "Yesterday $j_showyester at ".$j_time;<br />  }<br />  else {<br /><br />      if ($timeformat == "short1") {<br />        $time = @date("m/d/y h:i a", $time);<br />      }<br />      elseif ($timeformat == "short2") {<br />        $time = @date("d/m/y h:i a", $time);<br />      }<br />      elseif ($timeformat == "short3") {<br />        $time = @date("y/m/d h:i a", $time);<br />      }<br />      elseif ($timeformat == "short4") {<br />        $time = @date("d/m/Y H:i", $time);<br />      }<br />                elseif ($timeformat == "short5") {<br />                        $time = @date("H:i d/m/Y", $time);<br />                }<br />      elseif ($timeformat == "long") {<br />        $time = @date("D M d Y h:i a", $time);<br />      }<br />  }<br /><br />
<br /><br /> <br /><br />Disclaimer: Please backup every file that you intend to modify. <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /><br />Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.

Top
#285593 - 06/21/05 12:14 AM Re: Beta-[6.4] Today and Yesterday [Re: lexa1999]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
<img src="http://www.ubbdev.com/forum/images/graemlins/cool.gif" alt="" />
_________________________
- Allen wavey
- What Drives You?

Top
#285594 - 06/21/05 06:57 PM Re: Beta-[6.4] Today and Yesterday [Re: lexa1999]
ScriptZ Man Offline
User

Registered: 01/03/05
Posts: 38
Any suggestion for v6.5? <img src="http://www.ubbdev.com/forum/images/graemlins/crazy.gif" alt="" />

Top
#285595 - 06/22/05 07:17 AM Re: Beta-[6.4] Today and Yesterday [Re: Pumpkihn]
bostongio Offline
Lurker

Registered: 09/30/04
Posts: 8
I don't have copies of the other versions, so I can't check out and see if the code is similar or the same. Does such a subroutine exist in ubbt.inc.php in 6.5? If so, the mod should work just fine.

Top
#285596 - 06/22/05 07:40 AM Re: Beta-[6.4] Today and Yesterday [Re: lexa1999]
ScriptZ Man Offline
User

Registered: 01/03/05
Posts: 38
[]bostongio said:<br />I don't have copies of the other versions, so I can't check out and see if the code is similar or the same. Does such a subroutine exist in ubbt.inc.php in 6.5? If so, the mod should work just fine. [/]<br /><br />Unfortunately it doesn't <img src="http://www.ubbdev.com/forum/images/graemlins/crazy.gif" alt="" />

Top
#285597 - 06/22/05 09:11 AM Re: Beta-[6.4] Today and Yesterday [Re: Pumpkihn]
bostongio Offline
Lurker

Registered: 09/30/04
Posts: 8
Hmmm, how does 6.5 handle time conversion? I suspect the function is still in the code, but perhaps they just moved it or renamed it... Because there has to be a function to handle formatting the time and date to the board preferences....<br /><br />You could do a grep on timeformat or convert_time and see if it appears in some other file elsewhere. Sorry, if I get a chance I'll download a copy of 6.5 and look for it myself...

Top



Moderator:  Ian_W 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks